const KoaRouter = require('koa-router')
const HttpClient = require('../util/HttpClient')
const Template = require('../util/Template')

const router = new KoaRouter();
const modules = require('../../modules');

router.get('/export/download/message/:id', async ctx => {
  let script = ['/export.download.message.js'];
  let modConfig = modules['export.download.message'];
  let reqHeaders = ctx.request.headers;
  let result = await HttpClient.request('/export/download/message', 'get', null, {headers: reqHeaders});
  let body = result.body;
  
  ctx.body = await Template.renderWithHtml('导出成功通知', body, script, modConfig.template, ctx)
});



module.exports = router;
